import Pool from './base/pool'

let instance

/**
 * 全局状态管理器
 */
class DataBus {
  constructor() {
    if (instance) return instance

    instance = this
    this.pool = new Pool()
    this.reset()
  }

  reset() {
    this.frame = 0
    this.mode = 'startMovie'
    this.startMovie = this.pool.startMovie
    this.svSprites = this.pool.svSprites
    this.controllSprites = this.pool.controllSprites
    this.worldMap = this.pool.worldMap
    this.mapConverts = this.pool.mapConverts
    this.hero = this.pool.hero
    this.npcs = this.pool.npcs
    this.msgBox = this.pool.msgBox
    this.gameStatus={fu_mo_ji_mission_start: false,fu_mo_jian_mission_start:false,bai_cao_di_anim:false}
    this.movies = this.pool.movies
    this.gameOver = false
  }
}
const databus = new DataBus();

export  { databus };